#include <iostream>
using namespace std;

int main() {
    int n;
    while (cin >> n)
    {
        if (n == 0) break;
        int cnt = 0;
        while (n > 1)
        {
            ++cnt;
            n = n / 3 + (n % 3 > 0);
        }
        cout << cnt << endl;
    }
    return 0;
}